import 'package:equatable/equatable.dart';
import 'package:backend.core/core/domain/entities/web/web_money_amount.dart';

class YookassaTransactionRevocationInfo extends Equatable {
  const YookassaTransactionRevocationInfo({
    required this.time,
    required this.refundedAmount,
  });

  final DateTime time;
  final WebMoneyAmount refundedAmount;

  @override
  List<Object?> get props {
    return [
      time,
      refundedAmount,
    ];
  }

  YookassaTransactionRevocationInfo copyWith({
    DateTime Function()? time,
    WebMoneyAmount Function()? refundedAmount,
  }) {
    return YookassaTransactionRevocationInfo(
      time: time == null ? this.time : time(),
      refundedAmount: refundedAmount == null ? this.refundedAmount : refundedAmount(),
    );
  }
}
